package game.ai.scene;

import game.ai.IEyeShotManager;
import game.common.IntId;

public abstract class SceneObject {

	public static final byte SceneObjType_Hero = 1;
	public static final byte SceneObjType_MonsterScene = 2;
	public static final byte SceneObjType_Horse = 3;

	public static final byte SceneObjType_DropedGood = 5;
	public static final byte SceneObjType_MonsterBangqi = 6;

	protected Integer id; // id会经常做key值,所以不作基本类型
	protected short x;// x坐标
	protected short y;// y坐标

	private IScene sceneRef;// 场景引用

	private final static IntId objId = new IntId(0);

	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public short getX() {
		return x;
	}

	public void setX(short x) {
		this.x = x;
	}

	public short getY() {
		return y;
	}

	public void setY(short y) {
		this.y = y;
	}

	/*** 获得自己所关心的 场景对象类型 ******/
	public abstract byte[] getHeedSceneObject();

	public abstract byte getType();

	/**
	 * 获得视野管理器
	 * 
	 * @return
	 */
	public abstract IEyeShotManager getEyeShotManager();

	public IScene getSceneRef() {
		return sceneRef;
	}

	public void setSceneRef(IScene sceneRef) {
		this.sceneRef = sceneRef;
	}

	public static int getNextId() {
		return objId.getNextId();
	}

	abstract byte[] getAoiMode();

	/**
	 * 当我的位置变化时
	 */
	public void onMove() {
		getEyeShotManager().onMove();
	}

	public String toString() {
		return String.format("[id=%s,x=%s,y=%s]", id, x, y);
	}
}
